module.exports = function(sequelize, DataTypes) {
  var Location = sequelize.define('Location', {
    id : {type : DataTypes.INTEGER, primaryKey:true, autoIncrement:true},
    user_id: {
        type: DataTypes.INTEGER,
        references: "Users",
        referencesKey: 'id'
    },
    title:      DataTypes.STRING,
    url:        {
      type: DataTypes.STRING,
      notNull: true
    },
    faviconUrl: DataTypes.STRING,
    marked:     DataTypes.BOOLEAN,
    added:      DataTypes.DATE
  }, {
    classMethods: {
      associate: function(models) {
        Location.belongsTo(models.User);
        Location.hasMany(models.Group);
      }
    }
  });
 
  return Location
}